//所有接口返回数据类型都有的ts类型
export interface ResponseData {
  code: number;
  message: string;
  ok: boolean;
}

//定义SKU对象的ts类型
export interface SkuAttr {
  id?: number;
  attrId: number | string; //平台属性的ID
  valueId: number | string; //属性值的ID
}

export interface saleArr {
  id?: number;
  saleAttrId: number | string; //属性ID
  saleAttrValueId: number | string; //属性值的ID
}
//商品的图片数据类型
export interface SkuImage {
  id?: number;
  createTime?: string;
  updateTime?: string;
  spuId?: number;
  imgName?: string;
  imgUrl?: string;
}
export interface SkuData {
  id?: number;

  tmId?: number | string;
  category3Id?: number | string;
  spuId?: number | string;

  price?: number | string;
  weight?: number | string;
  skuName?: string;
  skuDesc?: string;

  skuDefaultImg?: string;
  isSale?: number;

  skuImageList?: SkuImage[];
  skuAttrValueList?: SkuAttr[];
  skuSaleAttrValueList?: saleArr[];
}
//获取SKU接口返回的数据ts类型
export interface SkuResponseData extends ResponseData {
  data: {
    records: SkuData[];
    total: number;
    size: number;
    current: number;
    pages: number;
  };
}

export interface SkuInfoData extends ResponseData {
  data: SkuData[];
}
